<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="/global/jsp-header.jsp"%>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<title>访问路径管理</title>
		<%@ include file="/global/html-header.jsp"%>
		<script type="text/javascript">
		$(function() {
			$(".myform").idealforms();
			$("#myform").submit();
			common.validator("myform");
			common.initDialog("message-dialog");
			common.initDelDialogMsg("确定要删除此访问路径？");
			
			$("#addActionUri").on("click",function(){
				$("#addorupdate-dialog").wijdialog({ width: 500, height: 440, contentUrl: '/action/action-uri-addorupdate.do?operationType=insert', autoOpen: true,modal : true,title:"新增访问路径" });
			});
			
			$("#delete-dialog").wijdialog({
	            autoOpen: false,
	            resizable: false,
	            height: 200,
	            width: 320,
	            modal: true,
	            title:'删除访问路径',
	            buttons: {
	                "确定": function () {
	                	if(!$("#delete-dialog").attr("operaterId")){
	                		return false;
	                	}
	                	var delActionUriId=$("#delete-dialog").attr("operaterId");
	                	$.ajax({   
	                		type: "POST",  
	                		url: "/action/action-uri-delete.do",  
	                		data: ({"actionUri.actionId":delActionUriId}), 
	                		success: function(msg){    
	                			if(msg=="success"){
	                				$("#msgcontent").html("访问路径删除成功！");
	                				$("#actionUriResultIframe").contents().find("tr[actionId='"+delActionUriId+"']'").remove();
	                			}else{
	                				$("#msgcontent").html("访问路径删除失败(有组别归属或系统异常)！");
	                			}
	                			common.tipWithAutoClose("message-dialog");
	                		} 
	                	});
	                    $(this).wijdialog("close");
	                },
	                "取消": function () {
	                    $(this).wijdialog("close");
	                }
	            }
	        });
		});
		//删除访问路径窗口弹出
		function deleteDivOpen(actionId){
			$('#delete-dialog').wijdialog('open');
			$('#delete-dialog').attr("operaterId",actionId);
		}
		
		function editActionUriTip(msg){
			$("#msgcontent").html(msg);
			common.tipWithAutoClose("message-dialog");
		}
		
		function editDivOpen(actionId){
			$("#addorupdate-dialog").wijdialog({ width: 500, height: 440, contentUrl: '/action/action-uri-addorupdate.do?operationType=update&actionUri.actionId='+actionId, autoOpen: true,modal : true,title:"编辑数据范围" });
		}
		
		function closeDialog(){
			$("#addorupdate-dialog").wijdialog('close');
		}
		
		function closeOperatorDialog(){
			$("#message-dialog").wijdialog('close');
		}
		
		function editActionRangeOperator(actionId){
			$("#message-dialog").wijdialog({ width: 500, height: 440, contentUrl: '/rbac/rbac-forward.do?operationType=actionuri&actionUri.actionId='+actionId, autoOpen: true,modal : true,title:"添加数据范围" });
		}
		
		function updateTitle(title){
			$("#ui-dialog-title-message-dialog").html(title);
		}
		</script>
	</head>
	<body>
		<div class="container ">
			<div class="content">
				<form action="/action/action-uri-query.do" name="myform" class="myform"
					id="myform" target="actionUriResultIframe" method="post">
					<div>
						<label>
							访问路径名称:
						</label>
						<input type="text" size="40" name="actionUri.uriName" />
					</div>
					<div>
						<label>
							访问路径值:
						</label>
						<input type="text" size="40" name="actionUri.uriValue" class="digits" />
					</div>
					<div>
						<label>
							&nbsp;
						</label>
						<input type="submit" value="提交" />
						<input type="reset"  value="重置" />
						<input type="button" id="addActionUri" value="新增" />
						<em class="ideal-button" style="visibility:hidden;"></em>
					</div>
				</form>
			</div>
			<div class="content hide" id="queryResult">
				<iframe class="actionUriResultIframe" name="actionUriResultIframe"
					id="actionUriResultIframe" src="about:blank" style="width: 97%;"
					frameborder="0" scrolling="no"></iframe>
			</div>
		</div>
		<%@ include file="/global/common-dialog.jsp" %>
	</body>
</html>